package com.gf.framework.weblog.model;

import com.gf.framework.mongo.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author gaofei
 * @date 2022/6/13 21:01
 */
@EqualsAndHashCode(callSuper = false)
@Data
@Document
@CompoundIndexes(value = {
        @CompoundIndex(name = "q_inedx", def = "{'url':1, 'dateTime':1}")
})
public class WebLogInfo extends BaseEntity {
    @ApiModelProperty("应用名")
    private String appName;
    @ApiModelProperty("调用的url")
    private String url;
    @ApiModelProperty("调用时间")
    private LocalDateTime callTime;
    @ApiModelProperty("是否调用成功")
    private Boolean success;
    @ApiModelProperty("失败原因")
    private String errorMessage;
    @ApiModelProperty("异常堆栈")
    private List<String> stackList;
    @ApiModelProperty("调用耗时")
    private Integer timeConsuming;
    @ApiModelProperty("调用参数")
    private Object[] args;
    @ApiModelProperty("返回值")
    private Object ret;
}
